<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@include file="/common/jsp/taglibs-nojs-nocss.jsp"%>
<%@include file="/common/jsp/cssAndScript.jsp"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"+ request.getServerName() + ":" + request.getServerPort()+ path + "/";
%>
<script type="text/javascript">
 	function submitUrl(){
 	 	var makeYear = document.getElementById("makeYear").value;
 	 	if(makeYear == ""){
			alert("请选择年！！");
 	 	}else{
	 		var url = "<%=basePath%>personPlan/startPlanByYear?planVo.user.id=<s:property value='#session.user.userId'/>&planYear="+makeYear;
	 		location.href = url;
 	 	}
 	}
 	function changeUser(userId){
		var url = "<%=basePath %>personPlan/getPlanTemplateByUidAndYear.action?userId="+userId;
		location.href=url;
 	}
</script>
<base href="<%=basePath%>"/>
<%@include file="/pages/head.jsp"%>
<div id="main_container">
  <div id="container_border">
        <div class="window_1">
        	<div id="assistFee_div">
            	<h3 class="priceRulelist_title_pic_2">员工计划管理</h3>
            	<a class="btn_box btn_file_icon2"  href="javascript:void(0)">
            		查看
            		<s:select id="users" list="users" onchange="changeUser(this.value)" name="user.id" headerKey="" headerValue="请选择" value="userId" listKey="id" listValue="cname" theme="simple"/>
            		员工计划
            	</a>
            	<si:role url="/personPlan/startPlanByYear.action">
	            	<a class="btn_box btn_file_icon2"  href="javascript:void(0)">启动
		            	<select id="makeYear" name="makeYear">
		            		<option value="">请选择</option>
		            		<option value="2011">2011</option>
		            		<option value="2012">2012</option>
		            		<option value="2013">2013</option>
		            		<option value="2014">2014</option>
		            		<option value="2015">2015</option>
		            		<option value="2016">2016</option>
		            		<option value="2017">2017</option>
		            		<option value="2018">2018</option>
		            		<option value="2019">2019</option>
		            		<option value="2020">2020</option>
		            	</select>年计划
		            	<input type="button" onclick="submitUrl()" value="提交"/>
            		</a>
            	</si:role>
        	</div>
        </div>
    <div class="window_bottom">
		<div id="pricerulemanage" style="height:450px;">         
            <table width="100%" border="0" cellpadding="0" style="table-layout:fixed;" cellspacing="0" class="gridview" id="pricerule_table">
                <thead>
                <tr class="title">
                    <td style="width: 5%">序号</td>
                    <td style="width: 11%">计划类型</td>
                    <td style="width: 11%">计划标题</td>
                    <td style="width: 12%">计划内容</td>
                    <td style="width: 10%">编写时间</td>
                    <td style="width: 8%">完成进度</td>
                    <td style="width: 10%">备注</td>
                    <td style="width: 6%">编写人</td>
                    <td style="width: 12%">领导批示</td>
                    <td style="width: 20%">操作</td>
                </tr>
                </thead>
                <tbody class="mytbody">
		                <s:iterator value="listNewPlan" status="stat">
			                <tr>
			                	<td><s:property value="#stat.count"/></td>
			                	<td align="right" style="width: 120px;">第 (<s:property value="planTemplate.name"/>) <s:property value="planTemplate.cname"/></td>
			                	<s:if test="isNull">
			                		<s:if test="userId==#session.user.userId">
				                		<s:if test="planTemplate.planType=='year'">
				                			<s:if test="status == 1">
				                				<td colspan="8">您还未开始本年度计划，请先<a href="javascript:void(0)" onclick="showDialog('新建年度计划','personPlan/gotoPlan?templateId=<s:property value="planTemplate.id"/>&planYear=<s:property value="planYear"/>',700,500)"> 新建 </a>年度计划。计划完成时间：<s:property value="thisBeginDate"/> 至 <s:property value="thisEndDate"/></td>
				                			</s:if>
				                			<s:elseif test="status == 2">
				                				<td colspan="8"><font color="red">您已经超期未完成年度计划，请尽快<a href="javascript:void(0)" onclick="showDialog('补充年度计划','personPlan/gotoPlan?templateId=<s:property value="planTemplate.id"/>&planYear=<s:property value="planYear"/>',700,500)"> 补充 </a>年度计划</font></td>
				                			</s:elseif>
				                			<s:elseif test="status == 3">
				                				<td colspan="8">本次计划将于 <s:property value="thisBeginDate"/> 开始,<s:property value="thisEndDate"/>结束，请及时制定计划</td>
				                			</s:elseif>
				                		</s:if>
				                		<s:elseif test="planTemplate.planType=='quarter'">
				                			<s:if test="status == 1">
				                				<td colspan="8">您还为开始本季度计划，请先<a href="javascript:void(0)" onclick="showDialog('新建季度计划','personPlan/gotoPlan?templateId=<s:property value="planTemplate.id"/>&planYear=<s:property value="planYear"/>',700,500)"> 新建 </a>季度计划。计划完成时间：<s:property value="thisBeginDate"/> 至 <s:property value="thisEndDate"/></td>
				                			</s:if>
				                			<s:elseif test="status == 2">
				                				<td colspan="8"><font color="red">您已经超期未完成季度计划，请尽快<a href="javascript:void(0)" onclick="showDialog('补充季度计划','personPlan/gotoPlan?templateId=<s:property value="planTemplate.id"/>&planYear=<s:property value="planYear"/>',700,500)"> 补充 </a>季度计划</font></td>
				                			</s:elseif>
				                			<s:elseif test="status == 3">
				                				<td colspan="8">本次计划将于 <s:property value="thisBeginDate"/> 开始,<s:property value="thisEndDate"/>结束，请及时制定计划</td>
				                			</s:elseif>
				                		</s:elseif>
				                		<s:elseif test="planTemplate.planType=='month'">
				                			<s:if test="status == 1">
				                				<td colspan="8">您还为开始本月计划，请先<a href="javascript:void(0)" onclick="showDialog('新建月度计划','personPlan/gotoPlan?templateId=<s:property value="planTemplate.id"/>&planYear=<s:property value="planYear"/>',700,500)"> 新建 </a>月度计划。计划完成时间：<s:property value="thisBeginDate"/> 至 <s:property value="thisEndDate"/></td>
				                			</s:if>
				                			<s:elseif test="status == 2">
				                				<td colspan="8"><font color="red">您已经超期未完成月计划，请尽快<a href="javascript:void(0)" onclick="showDialog('补充月度计划','personPlan/gotoPlan?templateId=<s:property value="planTemplate.id"/>&planYear=<s:property value="planYear"/>',700,500)"> 补充 </a>月计划</font></td>
				                			</s:elseif>
				                			<s:elseif test="status == 3">
				                				<td colspan="8">本次计划将于 <s:property value="thisBeginDate"/> 开始,<s:property value="thisEndDate"/>结束，请及时制定计划</td>
				                			</s:elseif>
				                		</s:elseif>
				                		<s:elseif test="planTemplate.planType=='week'">
				                			<s:if test="status == 1">
				                				<td colspan="8">您还为开始本周计划，请先<a href="javascript:void(0)" onclick="showDialog('新建周计划','personPlan/gotoPlan?templateId=<s:property value="planTemplate.id"/>&planYear=<s:property value="planYear"/>',700,500)"> 新建 </a>周计划。计划完成时间：<s:property value="thisBeginDate"/> 至 <s:property value="thisEndDate"/></td>
				                			</s:if>
				                			<s:elseif test="status == 2">
				                				<td colspan="8"><font color="red">您已经超期未完成周计划，请尽快<a href="javascript:void(0)" onclick="showDialog('补充周计划','personPlan/gotoPlan?templateId=<s:property value="planTemplate.id"/>&planYear=<s:property value="planYear"/>',700,500)"> 补充 </a>周计划</font></td>
				                			</s:elseif>
				                			<s:elseif test="status == 3">
				                				<td colspan="8">本次计划将于 <s:property value="thisBeginDate"/> 开始,<s:property value="thisEndDate"/>结束，请及时制定计划</td>
				                			</s:elseif>
				                		</s:elseif>
			                		</s:if>
			                	</s:if>
		                		<s:else>
		                			<td><s:property value="title"/></td>
		                			<td><s:property value="content"/></td>
		                			<td><s:property value="time"/></td>
		                			<td><s:property value="finish"/></td>
		                			<td><s:property value="memo"/></td>
		                			<td><s:property value="user.cname"/></td>
		                			<td>
		                				<a href="javascript:void(0)" onclick="showDialog('领导批示','personPlan/getLeaderInstructionsList?leaderInstructionsVo.planId=<s:property value="id"/>',600,400)">
		                					<s:property value="leaderSize"/>个批示
		                				</a>，
		                				<a href="javascript:void(0)" onclick="showDialog('领导批示','personPlan/getNoReadLeaderInstructionsList?leaderInstructionsVo.planId=<s:property value="id"/>&leaderInstructionsVo.userId=<s:property value="userId"/>',600,400)">
		                					<s:property value="noReaderLeaderSize"/>未读
		                				</a>
		                			</td>
		                		</s:else>
			                	<s:if test="status != 1 && status != 2 && status != 3">
		                			<td>
		                				<a href="javascript:void(0)" onclick="showDialog('查看计划详情','personPlan/getPlanById?planVo.id=<s:property value="id"/>',700,500)">查看计划详情</a>
		                				<s:if test="userId==#session.user.userId">
				                    		<a href="javascript:void(0)" onclick="showDialog('完成情况','pages/person/plan/planFinish.jsp?id=<s:property value="id"/>&planYear=<s:property value="planYear"/>',500,300)">完成情况</a>
				                    	</s:if>
				                    	<s:else>
				                    		<a href="javascript:void(0)" onclick="showDialog('领导批示','personPlan/getLeaderInstructionsList?leaderInstructionsVo.planId=<s:property value="id"/>',600,400)">领导批示</a>
				                    	</s:else>
				                    	<!-- 
			                    		<s:if test="planTemplate.planType=='year'">
			                    			<a href="javascript:void(0)" onclick="showDialog('查看本年日志','pages/person/plan/planFinish.jsp?id=<s:property value="id"/>',700,500)">查看本年日志</a>
			                    		</s:if>
			                    		<s:elseif test="planTemplate.planType=='quarter'">
			                    			<a href="javascript:void(0)" onclick="showDialog('查看本季度日志','pages/person/plan/planFinish.jsp?id=<s:property value="id"/>',700,500)">查看本季度日志</a>
			                    		</s:elseif>
			                    		<s:elseif test="planTemplate.planType=='month'">
			                    			<a href="javascript:void(0)" onclick="showDialog('查看本月日志','pages/person/plan/planFinish.jsp?id=<s:property value="id"/>',700,500)">查看本月日志</a>
			                    		</s:elseif>
			                    		<s:elseif test="planTemplate.planType=='week'">
			                    			<a href="javascript:void(0)" onclick="showDialog('查看本周日志','pages/person/plan/planFinish.jsp?id=<s:property value="id"/>',700,500)">查看本周日志</a>
			                    		</s:elseif> -->
				                    </td>
			                	</s:if>
			                </tr>
		                </s:iterator>
                </tbody>
           </table>
        </div> 
    </div>
    </div>
    </div>